package com.study.d2_iterator;

import java.util.ArrayList;
import java.util.Collection;

public class Test2 {
    public static void main(String[] args) {
        //掌握Collection集合遍历方式2：增强for
        Collection<String> list = new ArrayList<>();
        list.add("java");
        list.add("c++");
        list.add("python");
        list.add("rust");
        list.add("go");
        list.add("php");
        for (String s : list) {
            System.out.println(s);
        }
        int[] arr = {1,2,3};
        for (int i : arr) {
            System.out.println(i);
        }
    }
}
